/**
 *
 * Created by admin on 2017/2/28.
 * 用于添加挂载在 vue/window 实例下的默认的方法
 *
 */
import moment from 'moment';

moment.locale('zh-cn');
window.moment = moment;

function addMethods(Vue) {

    if (addMethods.installed) {
        return;
    }

    Vue.prototype.moment = moment;

    Vue.prototype.toAddress = function (address, query = {}) {
        this.$router.push({path: address, query: query})
    }

}

export default addMethods;
